package com.gaofei.goods.openfeign;

import com.gaofei.goods.hystrix.UserFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author : gaofee
 * @date : 16:14 2021/5/18
 * @码云地址 : https://gitee.com/itgaofee
 */
//1.要调用的服务名    2.该方法调用失败,hystrix为了保护当前服务,迅速触发该类的另外一个方法
@FeignClient(value = "user-service",fallback = UserFallBack.class)
@Component
public interface UserFeignClient {

    @GetMapping("/user/hello/{id}")
    public String hello(@PathVariable("id") String id );
}
